package com.qingluan.widget;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import android.text.format.DateFormat;

public class TimeHelper {
	public static String GetNowTime(){
				
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date   curDate   =   new   Date(System.currentTimeMillis());
		return dateFormat.format(curDate);
	}
	
	@SuppressWarnings("deprecation")
	public static String paraTimeByLong(long time){
		Date curDate = new Date(time);
		return curDate.toGMTString();
	}
	
	public static long getNowTimeLong(){
		return System.currentTimeMillis();
	}
	
	public static long ParaTimeByStringH(String hour) {
		int numHour = Integer.valueOf(hour);
		long millisecond = numHour * 3600000;
		return millisecond;
		
	}
	
	public static String toGMTString(Date date) {  
        SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK);  
        df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT"));  
        return df.format(date);  
    } 
}
